#include "../include/scNet/Client.hpp"
#include <iostream>

int main()
{
	scNet::Client client;
	// 连接尝试
	try {
		client.connect("127.0.0.1", 8080);
		// HTTP GET 请求
		client.send("GET / HTTP/1.1\r\nHost: localhost\r\n\r\n");

		// 接收响应
		std::string response = client.receive();
		// 控制台打印接收到的响应
		std::cout << "Server response: \n" << response << std::endl;
	} catch (const std::exception& e) {
        std::cerr << "Error: " << e.what() << std::endl;
        return 1;
	}
	return 0;
}


